<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="example">
        <!-- 字符串颠倒前 -->
        <p>Original message: "{{ message }}"</p>
        <!-- 字符串颠倒后 -->
        <p>Computed reversed message: "{{ reversedMessage }}"</p>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>
    <script>
        var vm = new Vue({
            el: '#example',
            data: {
                // 原数据
                message: 'Hello'
            },
            computed: {
                // 计算属性的 getter （默认的）
                reversedMessage: function () {
                // `this` 指向 vm 根实例 —— split?? reverse?? join??
                    return this.message.split('').reverse().join('')
                }
            }
        });
        
    </script>
</body>
</html>